package com.zjpg.forum.controller.test;

import com.zjpg.forum.common.AppResult;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.NonNull;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName AdminController
 * @Description: TODO
 * @Author: JCC
 * @CreateTime: 2023/8/27 21:38
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @ApiOperation("管理员登录")
    @PostMapping("login")
    public AppResult login(@ApiParam("管理员用户名") @RequestParam("adminName") @NonNull String adminName,
                           @ApiParam("管理员密码") @RequestParam("password") @NonNull String password) {
        return AppResult.success();
    }

    @ApiOperation("管理员注册")
    @PostMapping("/reg")
    public AppResult reg(@ApiParam("管理员用户名") @RequestParam("adminName") @NonNull String adminName,
                         @ApiParam("管理员昵称") @RequestParam("nickname") @NonNull String nickname,
                         @ApiParam("管理员密码") @RequestParam("password") @NonNull  String password,
                         @ApiParam("管理员确认密码") @RequestParam("passwordRepeat") @NonNull String passwordRepeat) {
        return AppResult.success();
    }
}
